class Bomb {
    constructor() {
        this.timer = null;
    }

    start() {
        this.timer = setTimeout(() => {
            console.log('💥 BOOM!');
        }, 3000);
    }

    clear() {
        if (this.timer) {
            clearTimeout(this.timer);
            console.log('炸弹已解除');
            this.timer = null;
        }
    }
}

// 创建两个炸弹实例
const b1 = new Bomb();
const b2 = new Bomb();

// 启动炸弹
b1.start();
b2.start();

// 1秒后清除b2的定时器
setTimeout(() => {
    b2.clear();
}, 1000);